<?php

use app\assets\TableAsset;
use app\widgets\ManagerTableOp;
use yii\helpers\Html;
use yii\helpers\Url;
use app\models\Outbound;
use app\models\Package;
use app\models\Cardtype;
use app\widgets\LinkPager;
/**
 * @var $this yii\web\View
 * @var $apiList app\models\Api[]
 */

TableAsset::register($this);

$this->title = '出库列表';
$this->params['breadcrumbs'][] = '出库管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php echo Html::beginForm('?', 'get', ['class'=>'form-inline']);?>
    <div class="form-group">
        <a href="<?php echo Url::to(['/admin/outbound/edit']);?>" class="btn btn-success btn-sm">出库</a>
    </div>
    <div class="form-group">
        <label for="search_order" class="sr-only">订单号</label>
        <?php echo Html::textInput('orderno', Yii::$app->request->get('orderno'), ['order' => 'orderno', 'class' => 'form-control', 'placeholder' => '订单号', 'style' => 'width: 120px;']);?>
    </div>
    <div class="form-group">
        <button class="btn btn-primary btn-sm">搜索</button>
    </div>
<?php echo Html::endForm();?>
    <table class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
            <th class="center">
                <label class="pos-rel">
                    <input type="checkbox" class="ace" />
                    <span class="lbl"></span>
                </label>
            </th>
            <th>订单名</th>
            <th>订单号</th>
            <th>时间</th>
            <th>数量</th>
            <th>单价</th>
            <th>总价</th>
            <th>操作</th>
        </tr>
        </thead>

        <tbody>
        <?php foreach ($list as $lists) {?>
            <tr>
                <td class="center"><label class="pos-rel"><input type="checkbox" class="ace" value="<?php echo $lists->id;?>" /><span class="lbl"><?php echo $lists->id;?></span></label></td>
               <td><?php echo Html::encode($lists->order->titles);?></td>
               <td><?php echo Html::encode($lists->orderno);?></td>
                <td><?php echo Yii::$app->formatter->asDateTime($lists->create_time);?></td>
                <td><?php echo Html::encode($lists->number);?></td>
                <td><?php echo Html::encode($lists->price);?></td>
                <td><?php echo Html::encode($lists->total_price);?></td>
                <td><?php echo ManagerTableOp::widget(['items' => [

                        ['icon' => 'fa fa-pencil', 'href' => Url::to(['/admin/outbound/modify', 'id' => $lists->id]), 'btn_class' => 'btn btn-xs btn-success', 'tip' => '修改', 'color' => 'green'],
                    ]]);?></td>
            </tr>
        <?php }?>
        </tbody>
    </table>
<?php echo LinkPager::widget(['pagination' => $pagination]);?>